use "UT08p_VoterValidation.dta"
hist model3 if prob_sample==1
hist model3 if responded == 1 & srs == 0

hist model3 if prob_sample==0
hist model3 if responded == 1 & srs == 1hist model3 if prim08==1
xtile yhat=model3, nquantiles(100)bys yhat: egen mean_prob = mean(model3)bys yhat: egen mean_turnout = mean(prim08)gen difference = abs(mean_prob - mean_turnout)bys yhat: gen N=_n==1egen wea = total(difference) if N==1replace wea = wea / 100sort weabrowse wea